package com.company.learning;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @Author: zhaoqi
 * @Date: 11/25/2019 7:15 PM
 * @Version 1.0
 */

public class AtomicIntegerDemo {

    //原子整数演示

    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger();
        int i = atomicInteger.incrementAndGet();
        System.out.println(i);
        int i1 = atomicInteger.incrementAndGet();
        System.out.println(i1);
        int andDecrement = atomicInteger.decrementAndGet();
        System.out.println(andDecrement);
    }


}
